home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmTrayIcon
- BorderStyle = 3 'Fixed Dialog
- Caption = "TrayIcon OCX Sample"
- ClientHeight = 1920
- ClientLeft = 1140
- ClientTop = 1515
- ClientWidth = 6540
- Height = 2325
- Icon = "frmTrayIcon.frx":0000
- Left = 1080
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 1920
- ScaleWidth = 6540
- ShowInTaskbar = 0 'False
- Top = 1170
- Width = 6660
- Begin VB.TextBox txtToolTip
- Height = 285
- Left = 840
- TabIndex = 11
- Top = 1560
- Width = 2835
- End
- Begin VB.CommandButton btnUpdateIcon
- Caption = "UpdateIcon"
- Height = 375
- Left = 5220
- TabIndex = 9
- Top = 420
- Width = 1215
- End
- Begin VB.CommandButton btnHideIcon
- Caption = "HideIcon"
- Height = 375
- Left = 3840
- TabIndex = 8
- Top = 420
- Width = 1275
- End
- Begin VB.CommandButton btnShowIcon
- Caption = "ShowIcon"
- Height = 375
- Left = 2460
- TabIndex = 7
- Top = 420
- Width = 1275
- End
- Begin VB.TextBox txtEvent
- Height = 315
- Left = 2460
- TabIndex = 5
- Top = 1140
- Width = 3975
- End
- Begin VB.CheckBox chkMouseMoveEvents
- Caption = "MouseMoveEvents"
- Height = 255
- Left = 120
- TabIndex = 3
- Top = 1200
- Width = 2115
- End
- Begin VB.CheckBox chkAutoUpdate
- Caption = "AutoUpdate"
- Height = 255
- Left = 120
- TabIndex = 2
- Top = 900
- Width = 2115
- End
- Begin VB.CheckBox chkVisible
- Caption = "Visible"
- Height = 255
- Left = 120
- TabIndex = 1
- Top = 600
- Width = 2115
- End
- Begin TRAYICONLibCtl.TrayIcon TrayIcon1
- Left = 6000
- Top = 1500
- _Version = 65536
- _ExtentX = 741
- _ExtentY = 741
- _StockProps = 0
- ToolTip = "TrayIcon OCX Sample"
- Icon = "frmTrayIcon.frx":0442
- End
- Begin VB.Label Label4
- Caption = "ToolTip"
- Height = 255
- Left = 120
- TabIndex = 10
- Top = 1560
- Width = 615
- End
- Begin VB.Label Label3
- Caption = "Methods"
- Height = 195
- Left = 2520
- TabIndex = 6
- Top = 120
- Width = 2055
- End
- Begin VB.Label Label2
- Caption = "Events"
- Height = 195
- Left = 2460
- TabIndex = 4
- Top = 900
- Width = 2115
- End
- Begin VB.Label Label1
- Caption = "Properties"
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 2115
- End
- Attribute VB_Name = "frmTrayIcon"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub btnHideIcon_Click()
- Dim success As Boolean
- success = TrayIcon1.HideIcon
- If TrayIcon1.Visible Then
- chkVisible = 1
- Else
- chkVisible = 0
- End If
- End Sub
- Private Sub btnShowIcon_Click()
- Dim success As Boolean
- success = TrayIcon1.ShowIcon
- If TrayIcon1.Visible Then
- chkVisible = 1
- Else
- chkVisible = 0
- End If
- End Sub
- Private Sub btnUpdateIcon_Click()
- Dim success As Boolean
- success = TrayIcon1.UpdateIcon
- If TrayIcon1.Visible Then
- chkVisible = 1
- Else
- chkVisible = 0
- End If
- End Sub
- Private Sub chkAutoUpdate_Click()
- If chkAutoUpdate = 1 Then
- TrayIcon1.AutoUpdate = True
- Else
- TrayIcon1.AutoUpdate = False
- End If
- End Sub
- Private Sub chkMouseMoveEvents_Click()
- If chkMouseMoveEvents = 1 Then
- TrayIcon1.MouseMoveEvents = True
- Else
- TrayIcon1.MouseMoveEvents = False
- End If
- End Sub
- Private Sub Form_Load()
- If TrayIcon1.Visible Then
- chkVisible = 1
- Else
- chkVisible = 0
- End If
- If TrayIcon1.AutoUpdate Then
- chkAutoUpdate = 1
- Else
- chkAutoUpdate = 0
- End If
- If TrayIcon1.MouseMoveEvents Then
- chkMouseMoveEvents = 1
- Else
- chkMouseMoveEvents = 0
- End If
- txtToolTip = TrayIcon1.ToolTip
- End Sub
- Private Sub TrayIcon1_LeftClick(ByVal x As Single, ByVal y As Single)
- txtEvent = "LeftClick at (x,y) = (" & x & ", " & y & ")"
- End Sub
- Private Sub TrayIcon1_LeftDblClick(ByVal x As Single, ByVal y As Single)
- txtEvent = "LeftDblClick at (x,y) = (" & x & ", " & y & ")"
- End Sub
- Private Sub TrayIcon1_MouseMoveOver(ByVal x As Single, ByVal y As Single)
- txtEvent = "MouseMoveOver at (x,y) = (" & x & ", " & y & ")"
- End Sub
- Private Sub TrayIcon1_RightClick(ByVal x As Single, ByVal y As Single)
- txtEvent = "RightClick at (x,y) = (" & x & ", " & y & ")"
- End Sub
- Private Sub TrayIcon1_RightDblClick(ByVal x As Single, ByVal y As Single)
- txtEvent = "RightDblClick at (x,y) = (" & x & ", " & y & ")"
- End Sub
- Private Sub txtToolTip_Change()
- TrayIcon1.ToolTip = txtToolTip
- End Sub
-